package de.jenseins.utils.propertytranslator.translation;

import com.google.api.translate.Language;
import com.google.api.translate.Translate;

/**
 * 
 * 
 * @author Jens Greive
 * @since 01.12.2009
 * 
 */
public class Translator {

  static {
    Translate.setHttpReferrer("http://www.oepo.de");
  }

  public static String getTranslation(String toTranslate, Language sourceLang, Language targetLang) throws Exception {
    String translatedText = Translate.execute(toTranslate, sourceLang, targetLang);
    return translatedText;
  }

}
